package com.zw.web.controller;

import com.zw.domain.User;
import com.zw.feign.FeignUserClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * 订单消费者服务
 */
@RestController
public class OrderController {

    @Autowired
    private FeignUserClient feignUserClient;

    /**
     * 该方法是浏览器来调用
     * @param id
     * @return
     */
    @GetMapping("/order/user/{id}")
    public User getUserById(@PathVariable("id") Long id){
        return feignUserClient.getUserById(id);
    }
}